package servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.time.LocalDate;
import java.util.Date;
import java.time.format.DateTimeFormatter;
import java.sql.Timestamp;
@WebServlet("/LoginServlet")
public class LoginServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

        PrintWriter pw=resp.getWriter();
        pw.write("<script language='javascript'>alert('打卡时间已过')</script>");
        String check=req.getParameter("mode");
        if(check.equals("1")){
            resp.sendRedirect("user.html");
        }else if(check.equals("2")){
            resp.sendRedirect("college.html");
        }else if(check.equals("3")){
            resp.sendRedirect("control.html");
        }else{
            resp.sendRedirect("index.html");
        }
    }
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        doPost(req, resp);
    }
}
